package edu.cueb.wmis.mapper;

import edu.cueb.wmis.pojo.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author liuzizhuo
 * @since 2021-04-19
 */
public interface RoleMapper extends BaseMapper<Role> {

    @Select("SELECT r.* FROM tb_role r LEFT JOIN tb_admin_role ar ON ar.`roleId`=r.`id` LEFT JOIN tb_admin a ON a.`id`=ar.`adminId` WHERE a.`id` = #{adminID}")
    List<Role> getRoles(Integer adminID);
}
